/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('ascp-sndop-compute-callback-service', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model RemoteComputeApiRequest {
  autoJobID?: long(name='AutoJobID'),
  excelID?: long(name='ExcelID'),
  cutScreenRobot?: string(name='CutScreenRobot'),
  cutScreenSheet?: string(name='CutScreenSheet'),
  autoTimeStrategy?: string(name='AutoTimeStrategy'),
  autoSwitch?: boolean(name='AutoSwitch'),
  autoAbility?: [ string ](name='AutoAbility'),
  cutScreenEmail?: string(name='CutScreenEmail'),
  projectID?: long(name='ProjectID'),
}

model RemoteComputeApiShrinkRequest {
  autoJobID?: long(name='AutoJobID'),
  excelID?: long(name='ExcelID'),
  cutScreenRobot?: string(name='CutScreenRobot'),
  cutScreenSheet?: string(name='CutScreenSheet'),
  autoTimeStrategy?: string(name='AutoTimeStrategy'),
  autoSwitch?: boolean(name='AutoSwitch'),
  autoAbilityShrink?: string(name='AutoAbility'),
  cutScreenEmail?: string(name='CutScreenEmail'),
  projectID?: long(name='ProjectID'),
}

model RemoteComputeApiResponseBody = {
  errMsg?: string(name='ErrMsg'),
  fail?: boolean(name='Fail'),
  model?: map[string]any(name='Model'),
  success?: boolean(name='Success'),
}

model RemoteComputeApiResponse = {
  headers: map[string]string(name='headers'),
  body: RemoteComputeApiResponseBody(name='body'),
}

async function remoteComputeApiWithOptions(tmpReq: RemoteComputeApiRequest, runtime: Util.RuntimeOptions): RemoteComputeApiResponse {
  Util.validateModel(tmpReq);
  var request = new RemoteComputeApiShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.autoAbility)) {
    request.autoAbilityShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.autoAbility, 'AutoAbility', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RemoteComputeApi', '2021-6-18', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function remoteComputeApi(request: RemoteComputeApiRequest): RemoteComputeApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return remoteComputeApiWithOptions(request, runtime);
}

model RemoteWneScreenCutServiceSendScreenCutToEmailRequest {
  receiverMailList?: [ string ](name='ReceiverMailList', description='param0'),
  picUrls?: [ string ](name='PicUrls', description='param1'),
  emailTitle?: string(name='EmailTitle', description='param2'),
}

model RemoteWneScreenCutServiceSendScreenCutToEmailShrinkRequest {
  receiverMailListShrink?: string(name='ReceiverMailList', description='param0'),
  picUrlsShrink?: string(name='PicUrls', description='param1'),
  emailTitle?: string(name='EmailTitle', description='param2'),
}

model RemoteWneScreenCutServiceSendScreenCutToEmailResponseBody = {
  errMsg?: string(name='ErrMsg', description='errMsg'),
  model?: string(name='Model', description='model'),
  success?: boolean(name='Success', description='success'),
}

model RemoteWneScreenCutServiceSendScreenCutToEmailResponse = {
  headers: map[string]string(name='headers'),
  body: RemoteWneScreenCutServiceSendScreenCutToEmailResponseBody(name='body'),
}

async function remoteWneScreenCutServiceSendScreenCutToEmailWithOptions(tmpReq: RemoteWneScreenCutServiceSendScreenCutToEmailRequest, runtime: Util.RuntimeOptions): RemoteWneScreenCutServiceSendScreenCutToEmailResponse {
  Util.validateModel(tmpReq);
  var request = new RemoteWneScreenCutServiceSendScreenCutToEmailShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.receiverMailList)) {
    request.receiverMailListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.receiverMailList, 'ReceiverMailList', 'json');
  }
  if (!Util.isUnset(tmpReq.picUrls)) {
    request.picUrlsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.picUrls, 'PicUrls', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RemoteWneScreenCutServiceSendScreenCutToEmail', '2021-6-18', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function remoteWneScreenCutServiceSendScreenCutToEmail(request: RemoteWneScreenCutServiceSendScreenCutToEmailRequest): RemoteWneScreenCutServiceSendScreenCutToEmailResponse {
  var runtime = new Util.RuntimeOptions{};
  return remoteWneScreenCutServiceSendScreenCutToEmailWithOptions(request, runtime);
}

model GetNameRequest {
  name?: string(name='Name'),
}

model GetNameResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  name?: string(name='Name'),
}

model GetNameResponse = {
  headers: map[string]string(name='headers'),
  body: GetNameResponseBody(name='body'),
}

async function getNameWithOptions(request: GetNameRequest, runtime: Util.RuntimeOptions): GetNameResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetName', '2021-6-18', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getName(request: GetNameRequest): GetNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNameWithOptions(request, runtime);
}

model RemoteWneSceenCutServiceSendScreenCutToGroupRequest {
  groupUrls?: string(name='GroupUrls', description='param0'),
  picUrl?: [ string ](name='PicUrl', description='param1'),
  keyword?: string(name='Keyword', description='param2'),
}

model RemoteWneSceenCutServiceSendScreenCutToGroupShrinkRequest {
  groupUrls?: string(name='GroupUrls', description='param0'),
  picUrlShrink?: string(name='PicUrl', description='param1'),
  keyword?: string(name='Keyword', description='param2'),
}

model RemoteWneSceenCutServiceSendScreenCutToGroupResponseBody = {
  errMsg?: string(name='ErrMsg', description='errMsg'),
  model?: string(name='Model', description='model'),
  success?: boolean(name='Success', description='success'),
}

model RemoteWneSceenCutServiceSendScreenCutToGroupResponse = {
  headers: map[string]string(name='headers'),
  body: RemoteWneSceenCutServiceSendScreenCutToGroupResponseBody(name='body'),
}

async function remoteWneSceenCutServiceSendScreenCutToGroupWithOptions(tmpReq: RemoteWneSceenCutServiceSendScreenCutToGroupRequest, runtime: Util.RuntimeOptions): RemoteWneSceenCutServiceSendScreenCutToGroupResponse {
  Util.validateModel(tmpReq);
  var request = new RemoteWneSceenCutServiceSendScreenCutToGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.picUrl)) {
    request.picUrlShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.picUrl, 'PicUrl', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RemoteWneSceenCutServiceSendScreenCutToGroup', '2021-6-18', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function remoteWneSceenCutServiceSendScreenCutToGroup(request: RemoteWneSceenCutServiceSendScreenCutToGroupRequest): RemoteWneSceenCutServiceSendScreenCutToGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return remoteWneSceenCutServiceSendScreenCutToGroupWithOptions(request, runtime);
}

model RemoteWneExcelServiceRequest {
  projectId?: long(name='ProjectId', description='projectId'),
  excelId?: long(name='ExcelId', description='excelId'),
}

model RemoteWneExcelServiceResponseBody = {
  errMsg?: string(name='ErrMsg', description='errMsg'),
  model?: map[string]any(name='Model'),
  success?: boolean(name='Success', description='success'),
}

model RemoteWneExcelServiceResponse = {
  headers: map[string]string(name='headers'),
  body: RemoteWneExcelServiceResponseBody(name='body'),
}

async function remoteWneExcelServiceWithOptions(request: RemoteWneExcelServiceRequest, runtime: Util.RuntimeOptions): RemoteWneExcelServiceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('RemoteWneExcelService', '2021-6-18', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function remoteWneExcelService(request: RemoteWneExcelServiceRequest): RemoteWneExcelServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return remoteWneExcelServiceWithOptions(request, runtime);
}

model RemoteWneExcelServiceSubmitRequest {
  wneSubmitReqs?: [ 
    {
      sheetNo?: long(name='SheetNo'),
      tableId?: long(name='TableId'),
      updTableJSONText?: string(name='UpdTableJSONText'),
    }
  ](name='WneSubmitReqs'),
  projectId?: long(name='ProjectId'),
  excelMetaId?: long(name='ExcelMetaId'),
}

model RemoteWneExcelServiceSubmitShrinkRequest {
  wneSubmitReqsShrink?: string(name='WneSubmitReqs'),
  projectId?: long(name='ProjectId'),
  excelMetaId?: long(name='ExcelMetaId'),
}

model RemoteWneExcelServiceSubmitResponseBody = {
  errMsg?: string(name='ErrMsg', description='errMsg'),
  model?: string(name='Model', description='model'),
  success?: boolean(name='Success', description='success'),
}

model RemoteWneExcelServiceSubmitResponse = {
  headers: map[string]string(name='headers'),
  body: RemoteWneExcelServiceSubmitResponseBody(name='body'),
}

async function remoteWneExcelServiceSubmitWithOptions(tmpReq: RemoteWneExcelServiceSubmitRequest, runtime: Util.RuntimeOptions): RemoteWneExcelServiceSubmitResponse {
  Util.validateModel(tmpReq);
  var request = new RemoteWneExcelServiceSubmitShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.wneSubmitReqs)) {
    request.wneSubmitReqsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.wneSubmitReqs, 'WneSubmitReqs', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RemoteWneExcelServiceSubmit', '2021-6-18', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function remoteWneExcelServiceSubmit(request: RemoteWneExcelServiceSubmitRequest): RemoteWneExcelServiceSubmitResponse {
  var runtime = new Util.RuntimeOptions{};
  return remoteWneExcelServiceSubmitWithOptions(request, runtime);
}

